#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import datetime, sys, json
import numpy as np
import pandas as pd

import pprint
import numpy as np

from sicut.AbsDPJob import AbsDPJob
from sicut.service.RequestSiCutAPI import RequestSiCutAPI
from sicut.service.RequestSiCostAPI import RequestSiCostAPI


def main():
    p_argv = sys.argv

    success, tmp_df = RequestSiCostAPI(p_mat_no='1').request()

    success, tmp_df = RequestSiCostAPI(p_mat_no='1').request()


    fixed_columns = ['MAT_NO', 'PRE_UNIT_CODE', 'PROD_END_TIME', 'MAT_ACT_WIDTH', 'MAT_ACT_WT',
                     'COMPLEX_DECIDE_CODE', 'IN_MAT_NO_1']
    df2 = pd.DataFrame(data=[], columns=fixed_columns)

    tmp_df = pd.DataFrame(data=[['A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7']], columns=fixed_columns)
    df2 = pd.merge(df2, tmp_df, on=fixed_columns, how='outer')


    tmp_df = pd.DataFrame(data=[['B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7']], columns=fixed_columns)
    df2 = pd.merge(df2, tmp_df, on=fixed_columns, how='outer')

    print(df2)

    return 0


if __name__ == '__main__':
    start = datetime.datetime.now()

    status = main()

    elapsed = float((datetime.datetime.now() - start).seconds)
    print("Time Used 4 All ----->>>> %f seconds" % (elapsed))
